package com.zy.chapter8

/**
 * @author: zhaoyi
 * @create: 2020-09-09 23:44
 * @description: ${description}
 **/
object Test extends App {

  val sz = new Employee("sz", 100)
  println(sz.getId)

  //匿名子类
  val em = new Employee("李四", 100) {
    val sex: String = "男"

    def say(): Unit = {
      println(s"我是超级员工 $name 工号 ${getId} 性别 $sex $address ")
    }
  }
  em.say()
  println(em.getClass)
  println(em.isInstanceOf[Employee]) //true
  println(sz.getClass)

}
